import java.util.Scanner;

public class demo010 {
    public static void main(String[] args){
        Scanner scan=new Scanner(System.in);
        System.out.println("请输入第一个数");
        int a=scan.nextInt();
        System.out.println("请输入第二个数");
        int b=scan.nextInt();
        int d=0;
        for (int i = 1; i <=a; i++) {
            if(a%i==0) {
                if(b%i==0) {
                    if(d<i) {
                        d=i;
                    }
                }
            }
        }
        System.out.println(d);
        int c=(a*b)/d;
        System.out.println(c);
    }
}
